Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "setDoNotTrack" handling #46

Merged
merged 1 commit into from
Nov 14, 2023
Merged

Conversation

mpdude
Copy link
Member

@mpdude mpdude commented Nov 14, 2023

The setDoNotTrack configuration value has to be pushed to the _paqs before the trackPageView setting. trackPageView seems to trigger the actual logging request when it is being processed.

With the old state of the code, setDoNotTrack was set too late and never became effective. A request to the Matomo server would be sent in any case, relying on the server-side "do not track" privacy feature to be enabled.

This change adds a new enable_do_not_track configuration setting which defaults to true.

When you set it to false, the setDoNotTrack command will not be used. You can push it to the _paq array yourself, possibly depending on client-side logic. But remember: It has to be in the _paq array before the trackPageView entry.

@mpdude mpdude merged commit 37967f0 into webfactory:master Nov 14, 2023
3 of 4 checks passed
@mpdude mpdude deleted the fix-do-not-track branch November 14, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant